<template>
  <div class="courseInfo">
    <div class="nav">
      <span>当前位置:</span><span>首页</span>><span>高清教程</span>><span>{{
        info.title
      }}</span>
    </div>
    <div class="body">
      <div class="content">
        <div class="vedio">
          <video controls src="@/assets/蓝铅笔快乐学宣传片2017.mp4"></video>
        </div>
        <div class="titlePage">
          <div class="title">
            <span>{{ info.title }}</span>
            <div class="icon">
              <span><i class="el-icon-star-on"></i>收藏</span>
              <span><i class="el-icon-share"></i>分享</span>
            </div>
          </div>
          <div class="classification">
            <span>{{ info.classifation }}</span>
            <span>{{ info.class1 }}</span>
            <span>{{ info.class2 }}</span>
            <span>{{ info.class3 }}</span>
          </div>
        </div>
        <div class="introductionPage">
          <span>教程简介:</span>
          <p>
            不会“打草稿”勾线？网易画师赤井羚一个视频教你如何设置超实用SAI笔刷！不会“打草稿”勾线？网易画师赤井羚一个视频教你如何设置超实用SAI笔刷！不会“打草稿”勾线？网易画师赤井羚一个视频教你如何设置超实用SAI笔刷！不会“打草稿”勾线？网易画师赤井羚一个视频教你如何设置超实用SAI笔刷！
          </p>
        </div>
        <div class="commentPage">
          <span>课程评论(0)</span>
          <div class="input">
            <el-input
              type="textarea"
              :rows="2"
              placeholder="请输入内容"
              v-model="textarea"
            >
            </el-input>
            <el-button class="primary" type="primary">发表</el-button>
          </div>
          <div class="comment">
            <span>全部评论(0)</span>
            <div class="commentInfo">
              <div>
                <img
                  src="https://ss.lanqb.com/20140121/avatar.jpg?imageView2/1/w/90/h/90"
                  alt=""
                />
              </div>

              <div class="info">
                <div class="name">名字</div>
                <p>感谢</p>
                <div class="icon">
                  <i class="iconfont icon-dianzan"></i><span>(0)</span>
                  <i class="iconfont icon-pinglun"></i><span>(0)</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="navLink">
        <div class="autorPage">
          <div class="autor">
            <img :src="info.autorImg" alt="" />
            <span class="name">{{ info.autorName }}</span>
          </div>
          <el-button class="elButton" type="primary" size="mini" round
            >关注</el-button
          >
        </div>
        <div class="advertise">
          <img
            src="https://assets-cdn.lanqb.com/imgv3/newWalfare/videobanner.png"
            alt=""
          />
        </div>
        <div class="courseRecommend">
          <span>推荐课程</span>
          <!-- "img","title","students","autorName" -->
          <div
            v-for="item in info.classinfo"
            :key="item.courseZID"
            @click="linkInfo(item.courseZID)"
          >
            <RecommendedCourses
              :img="item.img"
              :title="item.title"
              :students="item.students"
              :autorName="item.autorName"
            ></RecommendedCourses>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import RecommendedCourses from "@/components/ZComponents/recommendedCourses";

export default {
  data() {
    return {
      textarea: "",
      info: {},
    };
  },
  components: {
    RecommendedCourses,
  },
  methods: {
    linkInfo(id) {
      this.$router.go(0)
      console.log(id);
      this.$router.push({ path: "/courseInfoz", query: { id } });
    },
  },
  created() {
    const id = this.$route.query.id;
    this.axios("/zjr/courseInfoFindz", { params: { id } }).then((resovle) => {
      Object.assign(this.info, { ...resovle.data[0] });
      this.textarea = " ";
    });
  },
};
</script>

<style lang="scss" scoped>
.nav {
  margin: 0 auto;
  width: 1300px;
}
.body {
  margin: 0 auto;
  display: flex;
  //   flex-direction: column;
  width: 1300px;
  justify-content: space-between;
  .content {
    width: 960px;

    video {
      width: 960px;
      height: 540px;
      border-radius: 5px;
    }
    .titlePage {
      .title {
        padding-top: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .icon {
          span {
            margin-left: 20px;
            display: inline-block;
            height: 30px;
            font-size: 12px;
            line-height: 30px;
            color: #666666;
            i {
              font-size: 24px;
              vertical-align: middle;
            }
          }
        }
      }
      .classification {
        font-size: 12px;
        color: #b1b5b9;
        span {
          display: inline-block;
          background-color: #f6f8fa;
          padding: 5px 10px;
          margin-right: 20px;
          border-radius: 8px;
        }
      }
    }
  }
  .introductionPage {
    padding-top: 20px;
    padding-bottom: 20px;

    margin-top: 20px;
    border-top: 1px solid #ebebeb;
    border-bottom: 1px solid #ebebeb;

    p {
      color: #707070;
      font-size: 14px;
    }
  }
  .commentPage {
    padding-top: 20px;
    span {
      display: inline-block;
      padding-bottom: 20px;
    }
    .input {
      position: relative;
      padding: 20px;
      border: 1px solid #ebebeb;
      text-align: right;
      .primary {
        margin-top: 5px;
      }
    }
    .comment {
      border: 1px solid #ebebeb;

      .commentInfo {
        display: flex;
        img {
          width: 50px;
          height: 50px;
          border-radius: 25px;
        }
      }
    }
  }
  .navLink {
    .autorPage {
      border-radius: 5px;
      padding: 20px;
      display: flex;
      justify-content: space-between;
      background-color: #f6f8fa;
      width: 280px;
      height: 42px;
      .autor {
        height: 42px;
        display: flex;
        align-items: center;
        img {
          width: 42px;
          height: 42px;
          border-radius: 21px;
          vertical-align: middle;
          margin-right: 20px;
        }
        .name {
          font-size: 14px;
        }
      }
      .elButton {
        height: 30px;
      }
    }
    .advertise {
      margin-top: 10px;
      width: 320px;
      img {
        width: 320px;
        object-fit: cover;
      }
    }
    .courseRecommend {
      width: 320px;
    }
  }
}
</style>